package org.tinygroup.flow.impl;

import java.util.List;

import org.tinygroup.flow.ComponentInterface;
import org.tinygroup.flow.FlowExecutor;
import org.tinygroup.flow.config.ComponentDefine;
import org.tinygroup.flow.config.ComponentDefines;
import org.tinygroup.flow.containers.ComponentContainers;

public abstract class ComponentManagerImpl implements FlowExecutor{
	// 组件容器
    private ComponentContainers containers = new ComponentContainers();
    public void addComponents(ComponentDefines components) {
        containers.addComponents(components);
    }

    public void removeComponents(ComponentDefines components) {
        containers.removeComponents(components);
    }
    
    public ComponentInterface getComponentInstance(String componentName) {
    	return containers.getComponentInstance(componentName);
    }
    public void addComponent(ComponentDefine component) {
        containers.addComponent(component);
    }

    public void removeComponent(ComponentDefine component) {
        containers.removeComponent(component);
    }

    public ComponentDefine getComponentDefine(String componentName) {
        return containers.getComponentDefine(componentName);
    }
    public List<ComponentDefine> getComponentDefines() {
        return containers.getComponentDefines();
    }
}
